<template>
  <div class="AssetList">
    <el-main>
      <div>
        <el-form ref="form" :model="form" label-width="80px">
          <el-row :gutter="20">
            <el-col :span="8">
              <div class="grid-content bg-purple">
                <el-form-item label="资产类别">
                  <el-select v-model="form.assetType" placeholder="请选择资产类别">
                    <el-option label="土地、房屋及建筑物" value="Houses"></el-option>
                    <el-option label="通用设备" value="FlexibleUnit"></el-option>
                    <el-option label="专用设备" value="SpecialEquipment"></el-option>
                    <el-option label="交通运输设备" value="TransportEquipment"></el-option>
                    <el-option label="电气设备" value="ElectricalEquipment"></el-option>
                    <el-option label="电子产品及通讯设备" value="ElectronicProducts"></el-option>
                    <el-option label="仪器仪表设备" value="Instrument"></el-option>
                    <el-option label="文艺体育设备" value="SportsEquipment"></el-option>
                    <el-option label="图书文物及陈列品" value="Books"></el-option>
                    <el-option label="家具用具及其他类" value="Furniture"></el-option>
                  </el-select>
                </el-form-item>
              </div>
            </el-col>
            <el-col :span="8">
              <div class="grid-content bg-purple">
                <el-form-item label="资产名称">
                  <el-input v-model="form.assetName"></el-input>
                </el-form-item>
              </div>
            </el-col>
            <el-col :span="8">
              <div class="grid-content bg-purple-light">
                <el-form-item label="公司部门:">
                  <el-select v-model="form.department" placeholder="请选择公司部门">
                    <el-option label="* 市场部" value="marketingDepartment"></el-option>
                    <el-option label="* 销售部" value="salesDepartment"></el-option>
                    <el-option label="* 产品部" value="productDepartment"></el-option>
                    <el-option label="* 研发部" value="researchDepartment"></el-option>
                    <el-option label="* 生产部" value="productDepartment"></el-option>
                    <el-option label="* 人力资源部" value="resourcesDepartment"></el-option>
                  </el-select>
                </el-form-item>
              </div>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="12">
              <div class="grid-content bg-purple">
                <div class="block">
                  <span class="demonstration"> 购入日期:</span>
                  <el-date-picker
                    v-model="value6"
                    type="daterange"
                    range-separator="-"
                    start-placeholder="开始日期"
                    end-placeholder="结束日期"
                  ></el-date-picker>
                </div>
              </div>
            </el-col>
            <el-button type="primary" icon="el-icon-search">搜索</el-button>
            <!-- <el-button type="primary" icon="el-icon-menu">新建盘点任务单</el-button> -->
            <el-button type="primary" @click="dialogFormVisible = true" icon="el-icon-menu">新建盘点任务单</el-button>
            <el-dialog title="新建盘点单" :visible.sync="dialogFormVisible">
              <el-form :model="form">
                <el-form-item label="任务单名称" :label-width="formLabelWidth">
                  <el-input v-model="form.PropertyName" auto-complete="off" style="width:300px"></el-input>
                </el-form-item>
                <el-form-item label="分类用户" :label-width="formLabelWidth">
                  <el-input v-model="form.PropertyType" auto-complete="off" style="width:300px"></el-input>
                </el-form-item>
              </el-form>
              <div slot="footer" class="dialog-footer">
                <el-button @click="dialogFormVisible = false">取 消</el-button>
                <el-button type="primary" @click="dialogFormVisible = false">
                  <router-link to="/CountingTask">创 建</router-link>
                </el-button>
              </div>
            </el-dialog>
          </el-row>
        </el-form>
      </div>
      <el-table
        ref="multipleTable"
        :data="tableData3"
        border
        tooltip-effect="dark"
        style="width: 100%"
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="selection" width="55"></el-table-column>
        <el-table-column prop="State" label="报废单号" width="150"></el-table-column>
        <el-table-column prop="pictureUrl" label="报废日期" width="120"></el-table-column>
        <el-table-column prop="assetCode" label="处理人" width="120"></el-table-column>
        <el-table-column prop="assetName" label="报废说明" width="200"></el-table-column>
        <el-table-column prop="standardType" label="申请人" width="200"></el-table-column>
        <el-table-column prop="sn" label="申请日期" width="120"></el-table-column>
        <el-table-column prop="unit" label="资产编号" width="120"></el-table-column>
        <el-table-column prop="amount" label="资产名称" width="200"></el-table-column>
        <el-table-column prop="useCompany" label="备注" width="120"></el-table-column>
      </el-table>
      <div class="block">
        <el-row :gutter="20">
          <el-col :span="10">
            <div class="grid-content bg-purple">
              <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="currentPage4"
                :page-sizes="[10, 20, 30, 40]"
                :page-size="10"
                layout="prev, pager, next, sizes, jumper"
                :total="400"
              ></el-pagination>
            </div>
          </el-col>
        </el-row>
      </div>
    </el-main>
  </div>
</template>
<script>
export default {
  data() {
    return {
      form: {
        assetType:"",
        assetName:"",
        department: "",
      },
      tableData3: [
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄"
        },
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄"
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄"
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄"
        },
        {
          date: "2016-05-08",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄"
        },
        {
          date: "2016-05-06",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄"
        },
        {
          date: "2016-05-07",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄"
        }
      ],
      value6: "",
      currentPage1: 5,
      currentPage2: 5,
      currentPage3: 5,
      currentPage4: 4,
      multipleSelection: [],
      dialogTableVisible: false,
      dialogFormVisible: false,
      form: {
        name: "",
        region: "",
        date1: "",
        date2: "",
        delivery: false,
        type: [],
        resource: "",
        desc: ""
      },
      formLabelWidth: "120px"
    };
  },
  methods: {
    toggleSelection(rows) {
      if (rows) {
        rows.forEach(row => {
          this.$refs.multipleTable.toggleRowSelection(row);
        });
      } else {
        this.$refs.multipleTable.clearSelection();
      }
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    }
  }
};
</script>
<style lang="scss" scoped>
</style>
